package com.example.demofin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.demofin.pojo.Detail;
import com.example.demofin.response.Response;
import com.example.demofin.response.ResponseResult;
import com.example.demofin.serveice.impl.DetailService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

//最后都调用createOkResp来返回数据。失败就直接throw抛出写错误信息
@RestController
@RequestMapping("/Decundan")
public class ShContoller {

    @Resource
    private DetailService detailService;

    //查询书写格式
    @GetMapping("/Detail")
    @ResponseBody
    public ResponseResult<IPage> SelDetail(
            @RequestParam() Integer pageNum,
            @RequestParam() Integer pageSize,
             @RequestBody Map map){
        return Response.createOkResp(detailService.selDetail(pageNum,pageSize,map));
    }

}
